From 1566d988672c8c86813e1e748645aee44686de73 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 16 Dec 1998 00:52:46 +0000 Subject: [PATCH] Use base[NORMAL] instead of bg[PRELIGHT] so CLists now can be used in Tue Dec 15 19:50:41 1998 Owen Taylor * gtk/gtkctree.c gtk/gtkclist.c gtk/testgtk.c: Use base[NORMAL] instead of bg[PRELIGHT] so CLists now can be used in detergent commercials. --- ChangeLog | 12 +++++++++ ChangeLog.pre-2-0 | 12 +++++++++ ChangeLog.pre-2-10 | 12 +++++++++ ChangeLog.pre-2-2 | 12 +++++++++ ChangeLog.pre-2-4 | 12 +++++++++ ChangeLog.pre-2-6 | 12 +++++++++ ChangeLog.pre-2-8 | 12 +++++++++ gtk/gtkclist.c | 47 +++++++++++++++++++++-------------- gtk/gtkctree.c | 61 ++++++++++++++++++++++++++++++---------------- gtk/testgtk.c | 46 +++++++++++++++++----------------- tests/testgtk.c | 46 +++++++++++++++++----------------- 11 files changed, 199 insertions(+), 85 deletions(-) diff --git a/ChangeLog b/ChangeLog index fbb2ec0683..b22ac2ab72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Tue Dec 15 19:50:41 1998 Owen Taylor + + * gtk/gtkctree.c gtk/gtkclist.c gtk/testgtk.c: Use + base[NORMAL] instead of bg[PRELIGHT] so CLists now can be + used in detergent commercials. + +Tue Dec 15 16:54:09 1998 Owen Taylor + + * gtk/gtklabel.h: Moved gtk_label_set() compatiblity + define from to for + compatibility. + 1998-12-15 Jeff Garzik * configure.in, gdk/Makefile.am, gtk/Makefile.am: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index fbb2ec0683..b22ac2ab72 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,15 @@ +Tue Dec 15 19:50:41 1998 Owen Taylor + + * gtk/gtkctree.c gtk/gtkclist.c gtk/testgtk.c: Use + base[NORMAL] instead of bg[PRELIGHT] so CLists now can be + used in detergent commercials. + +Tue Dec 15 16:54:09 1998 Owen Taylor + + * gtk/gtklabel.h: Moved gtk_label_set() compatiblity + define from to for + compatibility. + 1998-12-15 Jeff Garzik * configure.in, gdk/Makefile.am, gtk/Makefile.am: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fbb2ec0683..b22ac2ab72 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +Tue Dec 15 19:50:41 1998 Owen Taylor + + * gtk/gtkctree.c gtk/gtkclist.c gtk/testgtk.c: Use + base[NORMAL] instead of bg[PRELIGHT] so CLists now can be + used in detergent commercials. + +Tue Dec 15 16:54:09 1998 Owen Taylor + + * gtk/gtklabel.h: Moved gtk_label_set() compatiblity + define from to for + compatibility. + 1998-12-15 Jeff Garzik * configure.in, gdk/Makefile.am, gtk/Makefile.am: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index fbb2ec0683..b22ac2ab72 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,15 @@ +Tue Dec 15 19:50:41 1998 Owen Taylor + + * gtk/gtkctree.c gtk/gtkclist.c gtk/testgtk.c: Use + base[NORMAL] instead of bg[PRELIGHT] so CLists now can be + used in detergent commercials. + +Tue Dec 15 16:54:09 1998 Owen Taylor + + * gtk/gtklabel.h: Moved gtk_label_set() compatiblity + define from to for + compatibility. + 1998-12-15 Jeff Garzik * configure.in, gdk/Makefile.am, gtk/Makefile.am: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index fbb2ec0683..b22ac2ab72 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +Tue Dec 15 19:50:41 1998 Owen Taylor + + * gtk/gtkctree.c gtk/gtkclist.c gtk/testgtk.c: Use + base[NORMAL] instead of bg[PRELIGHT] so CLists now can be + used in detergent commercials. + +Tue Dec 15 16:54:09 1998 Owen Taylor + + * gtk/gtklabel.h: Moved gtk_label_set() compatiblity + define from to for + compatibility. + 1998-12-15 Jeff Garzik * configure.in, gdk/Makefile.am, gtk/Makefile.am: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index fbb2ec0683..b22ac2ab72 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +Tue Dec 15 19:50:41 1998 Owen Taylor + + * gtk/gtkctree.c gtk/gtkclist.c gtk/testgtk.c: Use + base[NORMAL] instead of bg[PRELIGHT] so CLists now can be + used in detergent commercials. + +Tue Dec 15 16:54:09 1998 Owen Taylor + + * gtk/gtklabel.h: Moved gtk_label_set() compatiblity + define from to for + compatibility. + 1998-12-15 Jeff Garzik * configure.in, gdk/Makefile.am, gtk/Makefile.am: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index fbb2ec0683..b22ac2ab72 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +Tue Dec 15 19:50:41 1998 Owen Taylor + + * gtk/gtkctree.c gtk/gtkclist.c gtk/testgtk.c: Use + base[NORMAL] instead of bg[PRELIGHT] so CLists now can be + used in detergent commercials. + +Tue Dec 15 16:54:09 1998 Owen Taylor + + * gtk/gtklabel.h: Moved gtk_label_set() compatiblity + define from to for + compatibility. + 1998-12-15 Jeff Garzik * configure.in, gdk/Makefile.am, gtk/Makefile.am: diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index caf8a6895d..ca65edfd31 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -2523,7 +2523,7 @@ cell_size_request (GtkCList *clist, g_return_if_fail (GTK_IS_CLIST (clist)); g_return_if_fail (requisition != NULL); - get_cell_style (clist, clist_row, GTK_STATE_PRELIGHT, column, &style, + get_cell_style (clist, clist_row, GTK_STATE_NORMAL, column, &style, NULL, NULL); switch (clist_row->cell[column].type) @@ -4382,7 +4382,7 @@ gtk_clist_realize (GtkWidget *widget) gdk_window_set_user_data (clist->clist_window, clist); gdk_window_set_background (clist->clist_window, - &widget->style->bg[GTK_STATE_PRELIGHT]); + &widget->style->base[GTK_STATE_NORMAL]); gdk_window_show (clist->clist_window); gdk_window_get_size (clist->clist_window, &clist->clist_window_width, &clist->clist_window_height); @@ -4694,7 +4694,7 @@ gtk_clist_style_set (GtkWidget *widget, { gtk_style_set_background (widget->style, widget->window, widget->state); gtk_style_set_background (widget->style, clist->title_window, GTK_STATE_SELECTED); - gdk_window_set_background (clist->clist_window, &widget->style->bg[GTK_STATE_PRELIGHT]); + gdk_window_set_background (clist->clist_window, &widget->style->base[GTK_STATE_NORMAL]); } /* Fill in data after widget has correct style */ @@ -5429,7 +5429,7 @@ get_cell_style (GtkCList *clist, { gint fg_state; - if ((state == GTK_STATE_PRELIGHT) && + if ((state == GTK_STATE_NORMAL) && (GTK_WIDGET (clist)->state == GTK_STATE_INSENSITIVE)) fg_state = GTK_STATE_INSENSITIVE; else @@ -5441,8 +5441,12 @@ get_cell_style (GtkCList *clist, *style = clist_row->cell[column].style; if (fg_gc) *fg_gc = clist_row->cell[column].style->fg_gc[fg_state]; - if (bg_gc) - *bg_gc = clist_row->cell[column].style->bg_gc[state]; + if (bg_gc) { + if (state == GTK_STATE_SELECTED) + *bg_gc = clist_row->cell[column].style->bg_gc[state]; + else + *bg_gc = clist_row->cell[column].style->base_gc[state]; + } } else if (clist_row->style) { @@ -5450,8 +5454,12 @@ get_cell_style (GtkCList *clist, *style = clist_row->style; if (fg_gc) *fg_gc = clist_row->style->fg_gc[fg_state]; - if (bg_gc) - *bg_gc = clist_row->style->bg_gc[state]; + if (bg_gc) { + if (state == GTK_STATE_SELECTED) + *bg_gc = clist_row->style->bg_gc[state]; + else + *bg_gc = clist_row->style->base_gc[state]; + } } else { @@ -5459,8 +5467,12 @@ get_cell_style (GtkCList *clist, *style = GTK_WIDGET (clist)->style; if (fg_gc) *fg_gc = GTK_WIDGET (clist)->style->fg_gc[fg_state]; - if (bg_gc) - *bg_gc = GTK_WIDGET (clist)->style->bg_gc[state]; + if (bg_gc) { + if (state == GTK_STATE_SELECTED) + *bg_gc = GTK_WIDGET (clist)->style->bg_gc[state]; + else + *bg_gc = GTK_WIDGET (clist)->style->base_gc[state]; + } if (state != GTK_STATE_SELECTED) { @@ -5565,14 +5577,13 @@ draw_row (GtkCList *clist, if (clist_row->state == GTK_STATE_NORMAL) { - state = GTK_STATE_PRELIGHT; if (clist_row->fg_set) gdk_gc_set_foreground (clist->fg_gc, &clist_row->foreground); if (clist_row->bg_set) gdk_gc_set_foreground (clist->bg_gc, &clist_row->background); } - else - state = clist_row->state; + + state = clist_row->state; /* draw the cell borders and background */ if (area) @@ -5581,7 +5592,7 @@ draw_row (GtkCList *clist, if (gdk_rectangle_intersect (area, &cell_rectangle, &intersect_rectangle)) gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], + widget->style->base_gc[GTK_STATE_ACTIVE], TRUE, intersect_rectangle.x, intersect_rectangle.y, @@ -5596,7 +5607,7 @@ draw_row (GtkCList *clist, if (gdk_rectangle_intersect (area, &cell_rectangle, &intersect_rectangle)) gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], + widget->style->base_gc[GTK_STATE_ACTIVE], TRUE, intersect_rectangle.x, intersect_rectangle.y, @@ -5612,7 +5623,7 @@ draw_row (GtkCList *clist, { rect = &clip_rectangle; gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], + widget->style->base_gc[GTK_STATE_ACTIVE], TRUE, cell_rectangle.x, cell_rectangle.y, @@ -5625,7 +5636,7 @@ draw_row (GtkCList *clist, cell_rectangle.y += clist->row_height + CELL_SPACING; gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], + widget->style->base_gc[GTK_STATE_ACTIVE], TRUE, cell_rectangle.x, cell_rectangle.y, @@ -5809,7 +5820,7 @@ draw_rows (GtkCList *clist, } /* this is a small special case which exposes the bottom cell line - * on the last row -- it might go away if I change the way the cell + * on the last row -- it might go away if I change the wall the cell * spacings are drawn */ if (clist->rows == first_row) diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c index e4940fd32c..0a4179df9c 100644 --- a/gtk/gtkctree.c +++ b/gtk/gtkctree.c @@ -694,7 +694,7 @@ gtk_ctree_realize (GtkWidget *widget) } values.foreground = widget->style->fg[GTK_STATE_NORMAL]; - values.background = widget->style->bg[GTK_STATE_NORMAL]; + values.background = widget->style->base[GTK_STATE_NORMAL]; values.subwindow_mode = GDK_INCLUDE_INFERIORS; values.line_style = GDK_LINE_SOLID; ctree->lines_gc = gdk_gc_new_with_values (GTK_CLIST(widget)->clist_window, @@ -1392,32 +1392,52 @@ get_cell_style (GtkCList *clist, GdkGC **fg_gc, GdkGC **bg_gc) { + gint fg_state; + + if ((state == GTK_STATE_NORMAL) && + (GTK_WIDGET (clist)->state == GTK_STATE_INSENSITIVE)) + fg_state = GTK_STATE_INSENSITIVE; + else + fg_state = state; + if (clist_row->cell[column].style) { if (style) *style = clist_row->cell[column].style; if (fg_gc) - *fg_gc = clist_row->cell[column].style->fg_gc[state]; - if (bg_gc) - *bg_gc = clist_row->cell[column].style->bg_gc[state]; + *fg_gc = clist_row->cell[column].style->fg_gc[fg_state]; + if (bg_gc) { + if (state == GTK_STATE_SELECTED) + *bg_gc = clist_row->cell[column].style->bg_gc[state]; + else + *bg_gc = clist_row->cell[column].style->base_gc[state]; + } } else if (clist_row->style) { if (style) *style = clist_row->style; if (fg_gc) - *fg_gc = clist_row->style->fg_gc[state]; - if (bg_gc) - *bg_gc = clist_row->style->bg_gc[state]; + *fg_gc = clist_row->style->fg_gc[fg_state]; + if (bg_gc) { + if (state == GTK_STATE_SELECTED) + *bg_gc = clist_row->style->bg_gc[state]; + else + *bg_gc = clist_row->style->base_gc[state]; + } } else { if (style) *style = GTK_WIDGET (clist)->style; if (fg_gc) - *fg_gc = GTK_WIDGET (clist)->style->fg_gc[state]; - if (bg_gc) - *bg_gc = GTK_WIDGET (clist)->style->bg_gc[state]; + *fg_gc = GTK_WIDGET (clist)->style->fg_gc[fg_state]; + if (bg_gc) { + if (state == GTK_STATE_SELECTED) + *bg_gc = GTK_WIDGET (clist)->style->bg_gc[state]; + else + *bg_gc = GTK_WIDGET (clist)->style->base_gc[state]; + } if (state != GTK_STATE_SELECTED) { @@ -1735,9 +1755,9 @@ gtk_ctree_draw_lines (GtkCTree *ctree, >K_CTREE_ROW (parent)->row.background); } else if (state == GTK_STATE_SELECTED) - bg_gc = style->bg_gc[state]; + bg_gc = style->base_gc[state]; else - bg_gc = GTK_WIDGET (clist)->style->bg_gc[state]; + bg_gc = GTK_WIDGET (clist)->style->base_gc[state]; if (!area) gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE, @@ -1802,7 +1822,7 @@ gtk_ctree_draw_lines (GtkCTree *ctree, if (!area) gdk_draw_rectangle (clist->clist_window, GTK_WIDGET - (ctree)->style->bg_gc[GTK_STATE_PRELIGHT], + (ctree)->style->base_gc[GTK_STATE_NORMAL], TRUE, tree_rectangle.x, tree_rectangle.y, @@ -1812,7 +1832,7 @@ gtk_ctree_draw_lines (GtkCTree *ctree, &tc_rectangle)) gdk_draw_rectangle (clist->clist_window, GTK_WIDGET - (ctree)->style->bg_gc[GTK_STATE_PRELIGHT], + (ctree)->style->base_gc[GTK_STATE_NORMAL], TRUE, tc_rectangle.x, tc_rectangle.y, @@ -1993,14 +2013,13 @@ draw_row (GtkCList *clist, if (clist_row->state == GTK_STATE_NORMAL) { - state = GTK_STATE_PRELIGHT; if (clist_row->fg_set) gdk_gc_set_foreground (clist->fg_gc, &clist_row->foreground); if (clist_row->bg_set) gdk_gc_set_foreground (clist->bg_gc, &clist_row->background); } - else - state = clist_row->state; + + state = clist_row->state; gdk_gc_set_foreground (ctree->lines_gc, &widget->style->fg[clist_row->state]); @@ -2013,7 +2032,7 @@ draw_row (GtkCList *clist, if (gdk_rectangle_intersect (area, &cell_rectangle, crect)) gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], TRUE, + widget->style->base_gc[GTK_STATE_ACTIVE], TRUE, crect->x, crect->y, crect->width, crect->height); } else @@ -2022,7 +2041,7 @@ draw_row (GtkCList *clist, crect = &cell_rectangle; gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], TRUE, + widget->style->base_gc[GTK_STATE_ACTIVE], TRUE, crect->x, crect->y, crect->width, crect->height); } @@ -2069,7 +2088,7 @@ draw_row (GtkCList *clist, if (!area || gdk_rectangle_intersect (area, &cell_rectangle, crect)) { gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], TRUE, + widget->style->base_gc[GTK_STATE_ACTIVE], TRUE, crect->x, crect->y, crect->width, crect->height); /* horizontal black lines */ @@ -3163,7 +3182,7 @@ cell_size_request (GtkCList *clist, ctree = GTK_CTREE (clist); - get_cell_style (clist, clist_row, GTK_STATE_PRELIGHT, column, &style, + get_cell_style (clist, clist_row, GTK_STATE_NORMAL, column, &style, NULL, NULL); switch (clist_row->cell[column].type) diff --git a/gtk/testgtk.c b/gtk/testgtk.c index 00b68bd1bf..52f88989fb 100644 --- a/gtk/testgtk.c +++ b/gtk/testgtk.c @@ -3877,16 +3877,16 @@ insert_row_clist (GtkWidget *widget, gpointer data) col2.blue = 56000; style1 = gtk_style_copy (GTK_WIDGET (data)->style); - style1->bg[GTK_STATE_PRELIGHT] = col1; - style1->bg[GTK_STATE_SELECTED] = col2; + style1->base[GTK_STATE_NORMAL] = col1; + style1->base[GTK_STATE_SELECTED] = col2; style2 = gtk_style_copy (GTK_WIDGET (data)->style); - style2->fg[GTK_STATE_PRELIGHT] = col1; + style2->fg[GTK_STATE_NORMAL] = col1; style2->fg[GTK_STATE_SELECTED] = col2; style3 = gtk_style_copy (GTK_WIDGET (data)->style); - style3->fg[GTK_STATE_PRELIGHT] = col1; - style3->bg[GTK_STATE_PRELIGHT] = col2; + style3->fg[GTK_STATE_NORMAL] = col1; + style3->base[GTK_STATE_NORMAL] = col2; gdk_font_unref (style3->font); style3->font = gdk_font_load ("-*-courier-medium-*-*-*-*-120-*-*-*-*-*-*"); @@ -4159,8 +4159,8 @@ create_clist (void) col2.blue = 32000; style = gtk_style_new (); - style->fg[GTK_STATE_PRELIGHT] = col1; - style->bg[GTK_STATE_PRELIGHT] = col2; + style->fg[GTK_STATE_NORMAL] = col1; + style->base[GTK_STATE_NORMAL] = col2; gdk_font_unref (style->font); style->font = @@ -4397,13 +4397,13 @@ void change_style (GtkWidget *widget, GtkCTree *ctree) col2.blue = 56000; style1 = gtk_style_new (); - style1->bg[GTK_STATE_PRELIGHT] = col1; + style1->base[GTK_STATE_NORMAL] = col1; style1->fg[GTK_STATE_SELECTED] = col2; style2 = gtk_style_new (); - style2->bg[GTK_STATE_SELECTED] = col2; - style2->fg[GTK_STATE_PRELIGHT] = col1; - style2->bg[GTK_STATE_PRELIGHT] = col2; + style2->base[GTK_STATE_SELECTED] = col2; + style2->fg[GTK_STATE_NORMAL] = col1; + style2->base[GTK_STATE_NORMAL] = col2; gdk_font_unref (style2->font); style2->font = gdk_font_load ("-*-courier-medium-*-*-*-*-300-*-*-*-*-*-*"); @@ -4744,19 +4744,19 @@ void build_recursive (GtkCTree *ctree, gint cur_depth, gint depth, switch (cur_depth % 3) { case 0: - style->bg[GTK_STATE_PRELIGHT].red = 10000 * (cur_depth % 6); - style->bg[GTK_STATE_PRELIGHT].green = 0; - style->bg[GTK_STATE_PRELIGHT].blue = 65535 - ((i * 10000) % 65535); + style->base[GTK_STATE_NORMAL].red = 10000 * (cur_depth % 6); + style->base[GTK_STATE_NORMAL].green = 0; + style->base[GTK_STATE_NORMAL].blue = 65535 - ((i * 10000) % 65535); break; case 1: - style->bg[GTK_STATE_PRELIGHT].red = 10000 * (cur_depth % 6); - style->bg[GTK_STATE_PRELIGHT].green = 65535 - ((i * 10000) % 65535); - style->bg[GTK_STATE_PRELIGHT].blue = 0; + style->base[GTK_STATE_NORMAL].red = 10000 * (cur_depth % 6); + style->base[GTK_STATE_NORMAL].green = 65535 - ((i * 10000) % 65535); + style->base[GTK_STATE_NORMAL].blue = 0; break; default: - style->bg[GTK_STATE_PRELIGHT].red = 65535 - ((i * 10000) % 65535); - style->bg[GTK_STATE_PRELIGHT].green = 0; - style->bg[GTK_STATE_PRELIGHT].blue = 10000 * (cur_depth % 6); + style->base[GTK_STATE_NORMAL].red = 65535 - ((i * 10000) % 65535); + style->base[GTK_STATE_NORMAL].green = 0; + style->base[GTK_STATE_NORMAL].blue = 10000 * (cur_depth % 6); break; } gtk_ctree_node_set_row_data_full (ctree, sibling, style, @@ -4804,9 +4804,9 @@ void rebuild_tree (GtkWidget *widget, GtkCTree *ctree) mask1, pixmap2, mask2, FALSE, TRUE); style = gtk_style_new (); - style->bg[GTK_STATE_PRELIGHT].red = 0; - style->bg[GTK_STATE_PRELIGHT].green = 45000; - style->bg[GTK_STATE_PRELIGHT].blue = 55000; + style->base[GTK_STATE_NORMAL].red = 0; + style->base[GTK_STATE_NORMAL].green = 45000; + style->base[GTK_STATE_NORMAL].blue = 55000; gtk_ctree_node_set_row_data_full (ctree, parent, style, (GtkDestroyNotify) gtk_style_unref); diff --git a/tests/testgtk.c b/tests/testgtk.c index 00b68bd1bf..52f88989fb 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -3877,16 +3877,16 @@ insert_row_clist (GtkWidget *widget, gpointer data) col2.blue = 56000; style1 = gtk_style_copy (GTK_WIDGET (data)->style); - style1->bg[GTK_STATE_PRELIGHT] = col1; - style1->bg[GTK_STATE_SELECTED] = col2; + style1->base[GTK_STATE_NORMAL] = col1; + style1->base[GTK_STATE_SELECTED] = col2; style2 = gtk_style_copy (GTK_WIDGET (data)->style); - style2->fg[GTK_STATE_PRELIGHT] = col1; + style2->fg[GTK_STATE_NORMAL] = col1; style2->fg[GTK_STATE_SELECTED] = col2; style3 = gtk_style_copy (GTK_WIDGET (data)->style); - style3->fg[GTK_STATE_PRELIGHT] = col1; - style3->bg[GTK_STATE_PRELIGHT] = col2; + style3->fg[GTK_STATE_NORMAL] = col1; + style3->base[GTK_STATE_NORMAL] = col2; gdk_font_unref (style3->font); style3->font = gdk_font_load ("-*-courier-medium-*-*-*-*-120-*-*-*-*-*-*"); @@ -4159,8 +4159,8 @@ create_clist (void) col2.blue = 32000; style = gtk_style_new (); - style->fg[GTK_STATE_PRELIGHT] = col1; - style->bg[GTK_STATE_PRELIGHT] = col2; + style->fg[GTK_STATE_NORMAL] = col1; + style->base[GTK_STATE_NORMAL] = col2; gdk_font_unref (style->font); style->font = @@ -4397,13 +4397,13 @@ void change_style (GtkWidget *widget, GtkCTree *ctree) col2.blue = 56000; style1 = gtk_style_new (); - style1->bg[GTK_STATE_PRELIGHT] = col1; + style1->base[GTK_STATE_NORMAL] = col1; style1->fg[GTK_STATE_SELECTED] = col2; style2 = gtk_style_new (); - style2->bg[GTK_STATE_SELECTED] = col2; - style2->fg[GTK_STATE_PRELIGHT] = col1; - style2->bg[GTK_STATE_PRELIGHT] = col2; + style2->base[GTK_STATE_SELECTED] = col2; + style2->fg[GTK_STATE_NORMAL] = col1; + style2->base[GTK_STATE_NORMAL] = col2; gdk_font_unref (style2->font); style2->font = gdk_font_load ("-*-courier-medium-*-*-*-*-300-*-*-*-*-*-*"); @@ -4744,19 +4744,19 @@ void build_recursive (GtkCTree *ctree, gint cur_depth, gint depth, switch (cur_depth % 3) { case 0: - style->bg[GTK_STATE_PRELIGHT].red = 10000 * (cur_depth % 6); - style->bg[GTK_STATE_PRELIGHT].green = 0; - style->bg[GTK_STATE_PRELIGHT].blue = 65535 - ((i * 10000) % 65535); + style->base[GTK_STATE_NORMAL].red = 10000 * (cur_depth % 6); + style->base[GTK_STATE_NORMAL].green = 0; + style->base[GTK_STATE_NORMAL].blue = 65535 - ((i * 10000) % 65535); break; case 1: - style->bg[GTK_STATE_PRELIGHT].red = 10000 * (cur_depth % 6); - style->bg[GTK_STATE_PRELIGHT].green = 65535 - ((i * 10000) % 65535); - style->bg[GTK_STATE_PRELIGHT].blue = 0; + style->base[GTK_STATE_NORMAL].red = 10000 * (cur_depth % 6); + style->base[GTK_STATE_NORMAL].green = 65535 - ((i * 10000) % 65535); + style->base[GTK_STATE_NORMAL].blue = 0; break; default: - style->bg[GTK_STATE_PRELIGHT].red = 65535 - ((i * 10000) % 65535); - style->bg[GTK_STATE_PRELIGHT].green = 0; - style->bg[GTK_STATE_PRELIGHT].blue = 10000 * (cur_depth % 6); + style->base[GTK_STATE_NORMAL].red = 65535 - ((i * 10000) % 65535); + style->base[GTK_STATE_NORMAL].green = 0; + style->base[GTK_STATE_NORMAL].blue = 10000 * (cur_depth % 6); break; } gtk_ctree_node_set_row_data_full (ctree, sibling, style, @@ -4804,9 +4804,9 @@ void rebuild_tree (GtkWidget *widget, GtkCTree *ctree) mask1, pixmap2, mask2, FALSE, TRUE); style = gtk_style_new (); - style->bg[GTK_STATE_PRELIGHT].red = 0; - style->bg[GTK_STATE_PRELIGHT].green = 45000; - style->bg[GTK_STATE_PRELIGHT].blue = 55000; + style->base[GTK_STATE_NORMAL].red = 0; + style->base[GTK_STATE_NORMAL].green = 45000; + style->base[GTK_STATE_NORMAL].blue = 55000; gtk_ctree_node_set_row_data_full (ctree, parent, style, (GtkDestroyNotify) gtk_style_unref); -- 2.30.2